package com.bazaaroid.server.gae.core.dto.partner;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.bazaaroid.server.gae.core.persistence.model.partner.Discount.TimePeriod;
import com.bazaaroid.server.gae.util.DateUtil;

@XmlRootElement(name = "TimePeriod")
public class TimePeriodDTO {
	private TimePeriod timePeriod = null;

	public TimePeriodDTO() {}

	public TimePeriodDTO(TimePeriod timePeriod) {
		this.timePeriod = timePeriod;
	}

	@XmlElement
	public String getDateFrom() {
		return DateUtil.dateToString(timePeriod.getDateFrom());
	}

	@XmlElement
	public String getDateTo() {
		return DateUtil.dateToString(timePeriod.getDateTo());
	}
}
